<!--
 * @Author       : xiaowu wwl093000@163.com
 * @Date         : 2023-07-04 08:12:13
 * @LastEditTime : 2023-08-01 13:56:53
 * @LastEditors  : xiaowu wwl093000@163.com
 * @FilePath     : /erp-admin-ui/src/views/notice/notice-detail.vue
 * @Description  : -
-->
<template>
  <div class="app-container" v-loading="loading">
    <h2 class="container-title">{{ form.title }}</h2>
    <p class="container-time">{{ form.createTime }}</p>
    <div class="container-main-content" v-html="form.content"></div>
  </div>
</template>

<script>
import { detail } from "@/api/notice/notice";
export default {
  name: "NoticeDetail",
  data() {
    return {
      loading: false,
      form: {}
    };
  },
  created() {
    if (this.$route.params.id) this.detailFn(this.$route.params.id);
  },
  methods: {
    detailFn(id) {
      this.loading = true;
      detail(id).then(response => {
        this.loading = false;
        this.form = response.data;
      });
    },
  }
};
</script>

<style lang="scss">
.app-container {
  .container-title {
    text-align: center;
    margin: 0;
    padding: 30px 0 0;
  }
  .container-time {
    text-align: center;
    padding: 10px;
  }
  .container-main-content {
    padding: 15px;
    width: 60%;
    margin: 0 auto;
  }
}
</style>